[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
getmaxy() Get the Current y Resolution
#include <graphics.h>
int far getmaxy(void);
getmaxy() returns the maximum y screen coordinate for the current
graphics mode. This function is very useful for positioning text and
graphics on the screen.
Returns: The maximum y screen coordinate.
-------------------------------- Example ---------------------------------
The following statements center the string on the screen and print
it.
#include <graphics.h>
#include <conio.h>
int gdriver = DETECT;
int gmode;
main()
{
int maxx, maxy;
int xcenter, ycenter, adjx;
int len;
char *tst = "This string is centered.";
initgraph(&gdriver,&gmode,"");
maxx = getmaxx();
maxy = getmaxy();
xcenter = maxx/2;
ycenter = maxy/2;
len = strlen(tst)*8;
adjx = xcenter - len/2;
outtextxy(adjx,ycenter,tst);
getch();
closegraph();
}
See Also:
getmaxx()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson